# -*- coding:utf-8 -*-
# @file：contact_page.py
# @Time： 23:15
# @Author：Zhang Jinxia
from selenium.webdriver.common.by import By
from po_project.po_project_param.page.base_page import BasePage

class ContactPage(BasePage):

    # 实现定位元素单独维护
    _add_member=(By.CSS_SELECTOR,".js_add_member:nth-child(2)")

    def goto_add_member1(self):
        """
        跳转添加成员页面
        :return:返回添加成员页面
        """
        from po_project.po_project_param.page.add_member_page import AddMemberPage
        # 点击添加成员
        self.find(self._add_member).click()
        return AddMemberPage(self.driver)

    def get_member_list(self):
        """
        获取添加成员列表
        :return: 返回断言的值
        """
        # 注意获取多个列表数据用find_elements
        ele=self.driver.find_elements(By.CSS_SELECTOR,".member_colRight_memberTable_td:nth-child(2)")
        # 通过列表推导式获取列表名称
        name_list=[i.text for i in ele]
        print(name_list)
        return name_list
